<html>
<head>
  <title>角色管理</title>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <link href="../../build/common/base.css" rel="stylesheet">
  <script type="text/javascript" src="../../build/common/base.js"></script>
  <script type="text/javascript" src="../../build/common/gridList.js"></script>
</head>
<body class="panel-body">
<div class="panel panel-default search-panel">
  <div class="panel-heading">查询条件
    <a href="javascript:void(0)" class="pull-right">　<i class="fa  fa-angle-double-up"
                                                        toggle-collapse="#searchForm"></i> </a>
  </div>
  <div class="panel-body">
    <form id="searchForm" class="form-horizontal">
      <div class="form-group">
        <label class="control-label col-sm-1" for="name^VLK">角色名称</label>
        <div class="col-sm-2">
          <input type="text" class="form-control" id="name^VLK">
        </div>
        <label class="control-label col-sm-1" for="code^VLK">角色编号</label>
        <div class="col-sm-2">
          <input class="form-control" type="text" id="code^VLK">
        </div>
        <label class="control-label col-sm-1" for="available_^VLK">状态</label>
        <div class="col-sm-2">
          <select class="form-control" id="available_^VLK">
            <option value="">全部</option>
            <option value="0">禁用</option>
            <option value="1">启用</option>
          </select>
        </div>
        <div class="col-sm-3" style="text-align:left;">
          <button type="button" style="margin-left:50px" class="btn btn-primary fa-search">查询
          </button>
          <button type="button" style="margin-left: 50px" class="btn btn-primary fa-rotate-left">
            重置
          </button>
        </div>
      </div>
    </form>
  </div>
</div>
<table ab-grid data-id-field="id" data-url="/org/role/listJson">
  <thead>
  <tr>
    <th data-checkbox="true">ID</th>
    <th data-field="name">角色名称</th>
    <th data-field="code">角色编号</th>
    <th data-field="description">备注</th>
    <th data-field="available" data-sort='available' data-formatter="labelFormatter"
        data-value-style="1-启用-primary,0-禁用-danger,">状态
    </th>
    <th data-field="id" data-formatter="innerHtmlFormatter" data-title="管理">
      <a class='btn btn-outline btn-primary fa fa-wrench' qtip='资源分配'
         onclick="assignRoleRes('{id}')"></a>
    </th>
  </tr>
  </thead>
</table>
</body>
</html>
<script>
  function assignRoleRes(roleId) {
    var conf = {
      height: 600, width: 800,
      url: "/sys/sysResource/sysResourceRole.html?roleId=" + roleId,
      title: "角色资源分配",
      width: 400,
      height: 600,
      btn: false
    };
    $.Dialog.open(conf);
  }
</script>
